﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Toulr.Domains.System;
using Toulr.Domains;
using Toulr.Domains.Account;
using Toulr.Util.Ioc;
using Toulr.Services;

namespace Toulr.Models.Account
{
    public class SessionUser
    {
        private User m_currentUser;
        public Toulr.Domains.Account.User CurrentUser
        {
            get { return m_currentUser; }
            set { m_currentUser = value; }
        }

        private City m_userCity;

        public City UserCity
        {
            get
            {
                if (m_userCity == null)
                {
                    ICityService cityService = UnityHelper.GetInstance<ICityService>();
                    m_userCity = cityService.GetCityById(CurrentUser.UserCityId);
                }

                return m_userCity;
            }
        }
    }
}
